跳到主要内容

Copy

Creates a copy of an block content control. Ignores comments, footnote references, complex fields.

Syntax

expression.Copy();

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

This method doesn't have any parameters.

Returns

ApiBlockLvlSdt

Example

This example creates a copy of an block level content control.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
let paragraph = blockLvlSdt.GetContent().GetElement(0);
paragraph.AddText("This is an block level content control.");
doc.Push(blockLvlSdt);
doc.Push(blockLvlSdt.Copy());